;
(function($) {
	
	var EcharTool = function(){}
	
	EcharTool.makeLineChart = function(id,options) {

		var lineChartdefaultsOpts = {
			title : {
				text : 'CPU, MEM, JVM usage(%)'
			// , subtext: '%'
			},
			tooltip : {
				formatter : "{b}<br/>" + "{a0}:{c0}%<br/>" + "{a1}:{c1}%<br/>"
						+ "{a2}:{c2}% ",
				show : true,
				trigger : 'axis'
			},
			toolbox : {
				show : true,
				feature : {
					// mark : {show: true},
					dataView : {
						show : true,
						readOnly : false
					},
					magicType : {
						show : true,
						type : [ 'line', 'bar' ]
					},
					restore : {
						show : true
					},
					saveAsImage : {
						show : true
					}
				}
			},
			legend : {// 图例
				data : [ 'CPUUSED', 'MEMERYUSED', 'JVMHEAPUSED' ]
			},
			xAxis : [ {// 横坐标
				type : 'category',
				data : [ "10:00", "10:01", "10:02", "10:03", "10:04" ]
			} ],
			yAxis : [ {// 纵坐标
				type : 'value'
			} ],
			series : [ {
				"name" : "CPUUSED",
				"type" : "line",
				"data" : [ 5, 25, 45, 15, 15 ]
			}, {
				"name" : "MEMERYUSED",
				"type" : "line",
				"data" : [ 5, 10, 10, 40, 30 ]
			}, {
				"name" : "JVMHEAPUSED",
				"type" : "line",
				"data" : [ 55, 30, 10, 80, 50 ]
			} ]
		};

		var options = $.extend(lineChartdefaultsOpts, options);
		
		var myLineChart = echarts.init($("#"+id)[0]);
		
		myLineChart.setOption(options);
		  
		
	};
})(jQuery);

// $('div').lockDimensions('width').CSS('color', 'red');
